#ifndef DBUSE_H
#define DBUSE_H

#include <QtSql/QtSql>
#include "articlestruct.h"
class dbuse
{
public:
    dbuse();
//    dbuse(QString _dbName, QString _tableName);

public:
    bool dbExec(QString param);
    bool dbConnect(QString dbName);
    bool dbInsert(ArticleStruct ArtStrct);
//    bool dbCreate();
    bool dbTableCreate();
    //bool dbShow();//?
    void dbClose();
    void getModel(QSqlTableModel *model,QString param);
//    void setTableName(QString _tableName);
//    void setDBName(QString _dbName);

public:
    bool isConnected;
    QSqlError error;

private:
    QString tableName;
  //  QString dbName;
    QSqlDatabase db;



};

#endif // DBUSE_H
